package multiThread;

public class DeamonTest {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 20; i++) {
                    try {
                        Thread.sleep(200);
                        System.out.println("其他线程" + i);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }

            }
        });
        t1.setDaemon(true);
        t1.start();

        for (int i = 0; i <10 ; i++) {
            Thread.sleep(100);
            System.out.println("主线程---"+i);
        }
        System.out.println("主线程结束=======================");
    }
}
